﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AdminManager_Admin_LineManager : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DisplayInfo();
        }
    }

    private void DisplayInfo()
    {
        var linelist = (from n in TourContext.TourLine.ToList()
                        orderby n.DefaultSort descending, n.AddTime descending
                        select new
                        {
                            ID = n.ID,
                            Title = n.Title,
                            ClassName = TourStaticData.TourTypeList.Find(c => c.ID == n.TypeID).TypeName,
                            DefaultSort = n.DefaultSort
                        }).ToList();
        ListView1.DataSource = linelist;
        Page.DataBind();

    }


    protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        DataPagerUserControl1.SetPage(e.StartRowIndex, e.MaximumRows);
        DisplayInfo();
    }
}
